package com.vn.ld.api.client;

import java.util.HashMap;
import java.util.Map;

import org.apache.cxf.jaxrs.client.JAXRSClientFactory;

import com.vn.ld.api.user.service.RSUserService;

public class ClientFactory {
	private static Map<String, RSUserService> userServiceClientMap = new HashMap<String, RSUserService>();

	public static RSUserService getUserServiceClient(final String baseAddress) {
		RSUserService client = userServiceClientMap.get(baseAddress);
		if (client == null) {
			client = JAXRSClientFactory.create(baseAddress, RSUserService.class);
			userServiceClientMap.put(baseAddress, client);
		}
		return client;
	}
}
